home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
dvdraw
/
examples
/
datasource
/
exampledsdll.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-12
|
3KB
|
86 lines
/////////////////////////////////////////////////////////////////////////////
//
// ExampleDsDll.h : DataViews Data Source DLL interface header file
//
/////////////////////////////////////////////////////////////////////////////
#ifndef EXAMPLEDSDLL_H
#define EXAMPLEDSDLL_H
#include "DvDsDll.h"
/////////////////////////////////////////////////////////////////////////////
//
// VARDEFDATA--
// Data structure that is used to store the various variable
// definitions that get read in...
//
typedef struct tagVARDEFDATA {
ADDRESS m_pBuffer; // Static buffer we rebind to...
CString m_csVarName; // Variable name
CString m_csVarTypeName;// Variable type, i.e. V_F_TYPE = "FLOAT"
int m_nVarType; // Variable type, i.e. V_F_TYPE
int m_nRows; // Rows & Cols represent the variable's
int m_nCols; // shape. i.e. scaler, vector, matrix
double m_dLowRange; // Low range
double m_dHighRange; // High range
tagVARDEFDATA* next; // Link to next in list...
} VARDEFDATA;
/////////////////////////////////////////////////////////////////////////////
//
// DATABUFENTRY--
//
typedef struct tagDATABUFENTRY {
char* name; // String value
int type; // Constant value
char* name2; // A more useful, readable name
ADDRESS addr; // Base address
} DATABUFENTRY;
/////////////////////////////////////////////////////////////////////////////
// class CExampleDsDll
class CExampleDsDll : public CDvDsDll
{
public :
CExampleDsDll();
~CExampleDsDll() {}
private :
enum { NUM_DATA_TYPES = 11 };
static DATABUFENTRY m_TypeTable[NUM_DATA_TYPES];
VARDEFDATA* m_pVarDefList;
// Useful variable definitions to keep handy...
VARDEFDATA* m_pDefVar; // First one in list
VARDEFDATA* m_pDefTextVar; // For input objects needing text
private :
void SetVarTagName(VARDEFDATA* pData, const char* varName);
void GetVarTagName(DV_DSDLLDATA* pData);
void ReadVarDefinitions();
int GetNextWord(char** start, char** end, BOOL term);
BOOL OpenDataFile(CStdioFile& cFile);
char* LookupDataType(char* string, int* type);
ADDRESS LookupBaseAddr(int data_type);
void AlignVdpToVarDefinition(VARDESC vdp, VARDEFDATA* pVarData);
void AttachVdpToDefTextVar(DV_DSDLLDATA* pData);
void AttachVdpToDefVar(DV_DSDLLDATA* pData);
public :
void Release() { delete this; }
virtual int HandleRequest(DV_DSDLLDATA* pData, CWnd* pParent);
virtual void GetIdInfo(CString& mfgName, CString& objName, CString& versionStr);
};
#endif // EXAMPLEDSDLL_H